package com.wjk.blogs.service;

import com.wjk.blogs.dao.UserRepository;
import com.wjk.blogs.po.User;
import com.wjk.blogs.util.Md5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {

        User user=userRepository.findByUsernameAndPassword(username, Md5.code(password));
        //System.out.println("查到了"+user.getName()+":"+user.getPassword());
        return user;
    }


}
